package com.zhou.day3;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@ControllerAdvice
@Controller
@RequestMapping("controllertest")
public class ControllerTest {

//    private static final Logger logger = LoggerFactory.getLogger(ControllerTest.class);


    @ExceptionHandler(BizException.class)
    @RequestMapping(value = "test3")
    public ResultResponse test(BizException b) {
        StringBuilder stringBuilder = null;
        StringBuilder zhou = stringBuilder.append("zhou");
        return ResultResponse.error("出错了",b.getErrorMsg());
    }


}
